<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 御宅男 <530765310@qq.com>
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 登录验证
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class Coupons extends Validate
{

    //定义验证规则
    protected $rule = [
        'name|优惠券名称' => 'require',
        'effect_type|有效类型' => 'require',
        'cate_id|类型' => 'require',
        'value|购物券面值' => 'require',
        'min_amount|最低消费' => 'require',
        'total_count|发放张数' => 'require',
        'stock_type|库存类型' => 'require',
    ];

    // 登录验证场景定义
//    public function sceneUpdate()
//    {
//        return $this->only(['username', 'password', 'email', 'mobile', 'roleid'])
//            ->remove('password', 'require');
//    }

    //定义验证场景
    protected $scene = [
        'insert' => ['name', 'effect_type', 'cate_id', 'value', 'min_amount', 'stock_type'],
    ];

}
